**************************************************************
*** Replication code for "The 'Commitment trap' Revisited: ***
*** Experimental Evidence on Ambiguous Nuclear Threats" by ***
*** Michal Smetana, Marek Vranka, and Ondrej Rosendorf     ***
**************************************************************

*** The code was written in Stata 17.0 BE-Basic Edition ***

*** Please reach out to ondrej.rosendorf@fsv.cuni.cz if you have any questions concerning this replication file ***

*** IMPORTANT: This file is accompanied by the svr_jeps_replication_data3 dataset ***

*** Before proceeding with the replication, please make sure that the "asdoc", "coefplot", "estout" and "betterbar" package is installed ***

*** To install the estout package, use the following command ***

ssc install asdoc, replace

*** To install the coefplot package, use the following command ***

ssc install coefplot, replace

*** To install the estout package, use the following command ***

ssc install estout, replace

*** To install the betterbar package, use the following command ***

ssc install betterbar, replace

*** Setting the output scheme to black and white ***

set scheme s1mono

***************************************************
*** Replication of the results in the main text ***
***************************************************

*** Figure 7 (bar graph) - Response likelihood across treatments ***

* Generating a labelled version of the scenario_n variable
recode scenario_n (0=0 "Ambiguous threat") (1=1 "Explicit threat"), generate(scenario_n_label)

* Generating a bar graph with error bars
betterbarci economic conventional invade cyber nuclear nothing, over(scenario_n_label) bar format(%2.0f) vertical ylabel(0(10)100)

* Exporting the bar graph (Figure 7)
graph export F07.png

*************************************************
*** Replication of the results in Appendix 12 ***
*************************************************

*** Appendix 12, Table 1 - Independent samples t-test (Welch) ***

* Running the t-test (Welch) for individual likelihood estimates by scenario_n and generating tables
asdoc ttest nuclear, by(scenario_n) welch replace title(Table 1: Welch's t-test results) save(A12T01)
asdoc ttest conventional, by(scenario_n) welch rowappend save(A12T01)
asdoc ttest cyber, by(scenario_n) welch rowappend save(A12T01)
asdoc ttest invade, by(scenario_n) welch rowappend save(A12T01)
asdoc ttest economic, by(scenario_n) welch rowappend save(A12T01)
asdoc ttest nothing, by(scenario_n) welch rowappend save(A12T01)

*** Appendix 12, Figure 1 (coefficient plot) - Likelihood of nuclear response (DV), no subset ***

* Running the OLS regression model (Model 1)
regres nuclear i.scenario_n

* Storing the estimates (Model 1)
estimates store M1

* Running the OLS regression model with controls (Model 2)
regres nuclear i.scenario_n i.male age income i.education_bin i.party

* Storing the estimates (Model 2)
estimates store M2

* Generating the coefficient plot (Appendix 12, Figure 1)
coefplot M1, bylabel(Model 1) || M2, bylabel (Model 2) ||, drop(_cons) xline(0) coeflabels(1.scenario_n = "{bf:Treatment (explicit – ambiguity)}" 1.male = "Gender (male)" age = "Age" income = "Income" 1.education_bin = "Education (university degree)" 1.party = "Party (Democrat – Republican)" 2.party = "Party (Independent – Republican)")

* Exporting the coefficient plot (Appendix 12, Figure 1)
graph export A12F01.png

*** Appendix 12, Table 2 - OLS regression (Model 1 and 2) ***

* Generating a table with results (Appendix 12, Table 2)
esttab M1 M2 using A12T02.rtf, noeqlines eqlabels(none) eform nogaps se r2 varlabels(1.scenario_n "Treatment (explicit - ambiguity)" 1.male "Gender (male)" age "Age" income "Income" 1.education_bin "Education (university degree)" 1.party "Party (Democrat - Republican)" 2.party "Party (Independent - Republican)" _cons "Constant") drop(0.scenario_n 0.male 0.education_bin 0.party) mtitle("Nuclear response likelihood" "Nuclear response likelihood") title(Table 2: OLS regression of nuclear response likelihood) nonumbers mlabels("Model 1" "Model 2")

************************************************
*** Continue with svr_jeps_replication_code4 ***
************************************************